/*j07c8riwYnz20MYibuDbtCIBPar6MclKpDhfUw8JW074dWaFsohBkWqZkIgOpflJ*/
import { ajax } from 'nc-lightapp-front';
import { pageConfig } from '../const';
import { setBatchBtnsEnable } from './buttonClick';
import { handleCheck_range } from '../../card/events/buttonClick';
import ampub from 'ampub';

const { utils } = ampub;
const { listUtils } = utils;
const { setListValue } = listUtils;
const { tableId, pagecode, url } = pageConfig;

export default function(props, config, pks) {
    const data = {
        allpks: pks,
        pagecode
    };
    // 得到数据渲染到页面
    // 得到数据渲染到页面
    ajax({
        url: url.queryPageUrl,
        data,
        success: (res) => {
            if (res && res.data && res.data[tableId] && res.data[tableId].rows && res.data[tableId].rows.length > 0) {
                // 处理盘点范围多语
                res.data[tableId].rows.forEach((row) => {
                    handleCheck_range.call(this, row.values.check_range, true);
                });
            }
            setListValue.call(this, props, res);
            setBatchBtnsEnable.call(this, props, tableId);
        }
    });
}

/*j07c8riwYnz20MYibuDbtCIBPar6MclKpDhfUw8JW074dWaFsohBkWqZkIgOpflJ*/